package com.example.androidlearing2423.kotlin
fun  dataLeft(total: Int,used: Int): Int{
    return total - used
}
fun  main(){
    val  totalMB = 20 * 1024
    val  usedMB = 10 * 1024 + 480
    val leftMB = dataLeft(totalMB, usedMB)
    if (leftMB<1024){
        println("警告：剩余流量不足1GB!")
    }else{
        val  leftGB = leftMB/1024.0
        println(String.format("剩余%.2f GB",leftGB))
    }
}


